package com.eascs.p2p.common.entity;

import java.io.Serializable;
import javax.persistence.*;


import java.util.Date;
import java.util.List;


/**
 * The persistent class for the p2p_admin_resources database table.
 * 
 */
@Entity
@Table(name="p2p_admin_resources")
@NamedQuery(name="AdminResourceEntity.findAll", query="SELECT a FROM AdminResourceEntity a")
public class AdminResourceEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String id;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="create_time")
	private Date createTime;

	private String creator;

	private String description;

	@Column(name="parent_id")
	private String parentId;

	@Column(name="resDefault")
	private String resourceDefault;

	@Column(name="resource_code")
	private String resourceCode;

	@Column(name="resource_name")
	private String resourceName;

	@Column(name="resource_type")
	private int resourceType;

	@Column(name="resource_url")
	private String resourceUrl;

	private int sort;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="update_time")
	private Date updateTime;

	private String updator;

	 //非数据库字段
    @Transient
    List<AdminResourceEntity> subResources;
    
	public AdminResourceEntity() {
	}

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getCreator() {
		return this.creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getParentId() {
		return this.parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	

	public String getResourceDefault() {
		return resourceDefault;
	}

	public void setResourceDefault(String resourceDefault) {
		this.resourceDefault = resourceDefault;
	}

	public String getResourceCode() {
		return this.resourceCode;
	}

	public void setResourceCode(String resourceCode) {
		this.resourceCode = resourceCode;
	}

	public String getResourceName() {
		return this.resourceName;
	}

	public void setResourceName(String resourceName) {
		this.resourceName = resourceName;
	}


	public int getResourceType() {
		return resourceType;
	}

	public void setResourceType(int resourceType) {
		this.resourceType = resourceType;
	}

	public String getResourceUrl() {
		return this.resourceUrl;
	}

	public void setResourceUrl(String resourceUrl) {
		this.resourceUrl = resourceUrl;
	}

	public int getSort() {
		return this.sort;
	}

	public void setSort(int sort) {
		this.sort = sort;
	}

	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getUpdator() {
		return this.updator;
	}

	public void setUpdator(String updator) {
		this.updator = updator;
	}
	public List<AdminResourceEntity> getSubResources() {
		return subResources;
	}

	public void setSubResources(List<AdminResourceEntity> subResources) {
		this.subResources = subResources;
	}

	public void addToSubMenus(AdminResourceEntity menu){
        this.subResources.add(menu);
    }

}